import 'package:flutter/material.dart';

// 定义使用provider要共享的数据
// extend或者with ChangeNotifier，目的是模型改变，通知视图改变
class CounterViewModel with ChangeNotifier {
  int _counter = 100;

  int get counter => _counter;

  set counter(int value) {
    _counter = value;
    // 通知数据改变以刷新UI
    notifyListeners();
  }
}
